var o, e = require, t = module, n = exports, i = this && this.__extends || (o = function(e, t) {
    return (o = Object.setPrototypeOf || {
        __proto__: []
    } instanceof Array && function(e, t) {
        e.__proto__ = t;
    } || function(e, t) {
        for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n]);
    })(e, t);
}, function(e, t) {
    function n() {
        this.constructor = e;
    }
    o(e, t), e.prototype = null === t ? Object.create(t) : (n.prototype = t.prototype, 
    new n());
}), a = this && this.__decorate || function(e, t, n, o) {
    var i, a = arguments.length, c = a < 3 ? t : null === o ? o = Object.getOwnPropertyDescriptor(t, n) : o;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) c = Reflect.decorate(e, t, n, o); else for (var r = e.length - 1; 0 <= r; r--) (i = e[r]) && (c = (a < 3 ? i(c) : 3 < a ? i(t, n, c) : i(t, n)) || c);
    return 3 < a && c && Object.defineProperty(t, n, c), c;
};

Object.defineProperty(n, "__esModule", {
    value: !0
});

var r = e("PetManager"), s = e("TimeView"), c = e("BaseView"), l = e("SkinView"), d = e("GameConfig"), u = e("GameData"), p = e("UIManager"), h = e("AdManager"), f = e("WebManager"), g = cc._decorator, m = g.ccclass, y = g.property, v = function(t) {
    function e() {
        var e = null !== t && t.apply(this, arguments) || this;
        return e.skeleton = null, e.timeView = null, e;
    }
    return i(e, t), e.prototype.onEnable = function() {
        var e = this;
        r.default.getInstance().isHas(1) ? this.node.active = !1 : (this.refresh(), cc.systemEvent.on("hatch_hide", function() {
            cc.systemEvent.off("hatch_hide"), e.node.active = !1;
        }));
    }, e.prototype.onDisable = function() {
        cc.systemEvent.off("hatch_hide");
    }, e.prototype.onClickEgg = function() {
        var n = this;
        f.default.getInstance().sentLog("点击首页龙蛋按键"), p.default.getInstance().loadPnl("skin", null, function() {
            h.default.getInstance().hideAllBanner(), p.default.getInstance().hideAllPnl();
        }).then(function(e) {
            var t;
            e instanceof c.default && ((t = e).showItem(l.SkinItemType.PET), n.scheduleOnce(function() {
                t.petView.toggleContainer.toggleItems[1].check();
            }));
        });
    }, e.prototype.start = function() {}, e.prototype.refresh = function() {
        var e, t = this;
        !r.default.getInstance().isHas(1) && 0 < u.GD.hatchLastTime && (this.timeView.node.active = !0, 
        e = Math.floor((Date.now() - u.GD.hatchLastTime) / 1e3), cc.log("offectTime", e), 
        e < d.GC.hatchConfig.time ? (this.timeView.init(d.GC.hatchConfig.time - e), this.timeView.node.on("finished", function() {
            t.node.active = !1;
        }), this.timeView.startTimer()) : this.node.active = !1);
    }, a([ y(sp.Skeleton) ], e.prototype, "skeleton", void 0), a([ y(s.default) ], e.prototype, "timeView", void 0), 
    a([ m ], e);
}(cc.Component);

n.default = v;